﻿using Dto;
using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace ZY13.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MemberController : ControllerBase
    {
        public MemberController(IMemberBLL bll)
        {
            Bll = bll;
        }

        public IMemberBLL Bll { get; }
        [HttpPost]
        public Task<int> AddMember(MembersModel members)
        {
            return Bll.AddMember(members);
        }
        [HttpGet]
        public Task<int> DeleteMember(int id)
        {
            return Bll.DeleteMember(id);
        }
        [HttpGet]
        public MembersModel Ft(int id)
        {
            return Bll.Ft(id);
        }
        [HttpGet]
        public MemberShowDto MemberShow(int pageindex, int pagesize)
        {
            return Bll.MemberShow(pageindex, pagesize);
        }
        [HttpPost]
        public Task<int> UpdateMember(MembersModel members)
        {
            return Bll.UpdateMember(members);
        }
    }
}
